﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="d" uri="/WEB-INF/resource.tld" %>

<d:resource root="${ctx.resource}/build" type="script" src="js/build.js">
  <script src="${ctx.resource}/js/vendor/require.js"></script>
  <script>
    require.config({
      urlArgs: "current=v0.1.8",
      baseUrl: '${ctx.resource}/ever-green/js',
      paths: {
        'jquery':           'vendor/jquery-1.11.0.min',
        'utils':            'utils',
        'underscore':       'vendor/underscore',
        'bootstrap':        'vendor/bootstrap',
        'app':              'app',
        'select2':          'component/select2.min',
        'select2.zh' :      'component/select2_locale_zh-CN',
        'validate':         'component/bootstrap.validate',
        'validate.en':      'component/bootstrap.validate.en',
        'shiftform':        'component/shiftform',
        'bootstrapTable':   'component/bootstrap-table.min',
        'bootstrapTableCN': 'component/bootstrap-table-zh-CN.min',
        'datetimepicker':   'component/bootstrap-datetimepicker',
        'datetimepickerCN': 'component/bootstrap-datetimepicker.zh-CN',
        'switch' :          'component/bootstrap-switch.min',
        'textareaAutosize': 'component/jquery.autosize.min',
        'date':             'component/date',
        'date.zh':          'component/date-zh-CN',
        'nicescroll':       'component/jquery.nicescroll.min',
        'countdown':        'component/jquery.flipcountdown',
        'fullpage':         'component/jquery.fullpage.min',
        'ajaxTab':          'ajax-tab'
      },
      shim: {
        'utils': { deps: ['jquery'] },
        'bootstrap': { deps: ['jquery'] },
        'fullpage': { deps: ['jquery'] },
        'app': { deps: ['jquery'] },
        'select2': { deps: ['jquery', 'bootstrap'] },
        'select2.zh':  { deps: ['jquery', 'bootstrap', 'select2'] },
        'validate': { deps: ['jquery'] },
        'uploader': { deps: ['jquery'] },
        'validate.en': { deps: ['jquery', 'validate'] },
        'bootstrapTable': { deps: ['jquery', 'bootstrap'] },
        'popover': { deps: ['jquery', 'bootstrap'] },
        'bootstrapTableCN': { deps: ['jquery', 'validate', 'bootstrapTable'] },
        'datetimepicker': { deps: ['jquery', 'bootstrap'] },
        'datetimepickerCN': { deps: ['jquery', 'bootstrap', 'datetimepicker'] },
        'editorConfig': { deps: ['jquery', 'bootstrap'] },
        'editor': { deps: ['jquery', 'bootstrap'] },
        'zh': { deps: ['jquery', 'bootstrap', 'editor'] },
        'upload': { deps: ['jquery', 'bootstrap', 'editor', 'zh'] },
        'switch' : { deps: ['jquery', 'bootstrap'] },
        'ajaxTab' : { deps: ['jquery', 'bootstrap'] },
        'textareaAutosize': { deps: ['jquery'] },
        'nicescroll': { deps: ['jquery'] },
        'countdown': { deps: ['jquery'] }
      },
    })
    
    // require jquery, bootstrap , jarvis as global js
    require(['jquery', 'bootstrap'], function() {
    })
  </script>
</d:resource>
<script type="text/javascript">
  (function(w) {
    w.__CTX__ = {
      root: '${ctx.host}',
      resource: '${ctx.resource}',
      rootDomain: '${ctx.domain}',
      cloudTemp: '${cloud.temp}',
      cloudProd: '${cloud.prod}',
      cloudIframe: '${cloud.iframe}',
      cloudUptoken: '${cloud.token}'
    } 
    w.UEDITOR_HOME_URL  = window.__CTX__.resource + "/js/ueditor/";
  })(window)
</script>